<?php  echo $_SERVER['SCRIPT_NAME']."<BR>"; ?>
<?php
	echo "<b>Intro: Let's do a little generic database work!</b><BR><BR>";
	$user = "user1";
	$passwd = "testing";
	
	// Connecting to and selecting a database
	$connect = mysql_connect('localhost', $user, $passwd)
	   or die('Could not connect: ' . mysql_error());
	echo '<b>Step 1:</b> Connected successfully! <BR>';
	
	$db = 'samples';
	mysql_select_db($db) or die('Could not select database ('.$db.') because of : '.mysql_error());
	echo '<b>Step 2:</b> Connected to ('.$db.') successful!<BR>';
	
	// Now we close the connection...
	mysql_close($connect);
?>